package com.atguigu.dga.governance.assessor.storage;

import com.atguigu.dga.governance.assessor.Assessor;
import com.atguigu.dga.governance.bean.AssessParam;
import com.atguigu.dga.governance.bean.GovernanceAssessDetail;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @Description: 是否空表
 * @Author: lay
 * @Date: 2024/6/28 14:54
 */
@Component("TABLE_EMPTY")
public class TableEmptyAssessor extends Assessor {
    @Override
    public void checkProblem(GovernanceAssessDetail governanceAssessDetail, AssessParam assessParam) {
        Long tableSize = assessParam.getTableMetaInfo().getTableSize();
        if (tableSize <= 0L){
            governanceAssessDetail.setAssessScore(BigDecimal.ZERO);
            governanceAssessDetail.setAssessProblem("空表");
        }
    }
}
